package hash.JDKhash;

import java.util.Objects;

public class Test2 {
    public static void main(String[] args) {
        int n=16;
        System.out.println(17&(n-1));
        System.out.println(17%16);
        System.out.println(34&(n-1));
        System.out.println(34%16);
    }

}

class Student{
    private String name;
    private int age;

    @Override
    public int hashCode() {
        return Objects.hash(name, age);
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public boolean equals(Object obj){
        if (this==obj){
            return true;
        }
        if (obj instanceof Student){
            Student stu=(Student) obj;
            return this.age==stu.age&&this.name.equals(stu.name);
        }
        return false;
    }
}